package org.KeyCrafter.server;

import org.KeyCrafter.cmd.Command;
import org.KeyCrafter.server.aof.AofAttribute;
import org.KeyCrafter.server.aof.LoadingInfo;
import org.KeyCrafter.server.session.ClientSession;

public interface ServerContext {

    ServerContext DEFAULT = new DefaultServerContext();

    int LRU_CLOCK();
    KVDB db(int i);
    int dbNum();
    Command lookupCommand(String name);
    void setCurrentClient(ClientSession c);
    void addClient(ClientSession c);
    ServerStatistics getStatistics();
    AofAttribute getAOFAttribute();
    BackgroundServer getBackgroundServer();
    long mstime();
    LoadingInfo getLoadingInfo();
    long getDirty();
    // dirty 自增
    void incrDirty();
    // dirty 增加
    void addDirty(int delta);
    // 返回工作目录
    String getWorkDir();
}
